﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DistributedGraph
{
    public delegate void SimpleAlgorithmEvent<T>(IAlgorithmController<T> controler) where T : Node, new();
    public delegate void ProgressAlgorithmEvent(int fromRound, int toRound, int process);

    /// <summary>
    /// Enumerator für Eingabewerte einwertig oder mehrwertig.
    /// </summary>
    public enum AlgorithmInput
    {
        SingleValue,
        MultiValue
    }

    /// <summary>
    /// Schnittstelle für den Algorithmuscontroller.
    /// </summary>
    /// <typeparam name="T">Der Knotentyp</typeparam>
    public interface IAlgorithmController<T> where T : Node, new()
    {
        string Name { get; }
        List<T> Nodes { get; }

        int Round { get; }
        int MaxRounds { get; }
        int CurrentProcess { get; }

        event SimpleAlgorithmEvent<T> StateChanged;
        event ProgressAlgorithmEvent RoundFinished;
        event ProgressAlgorithmEvent ProcessStarted;
        
        void NextProcess();
        void FinishRound();
        void Finish();
    }
}
